﻿@model BeYourMarket.Model.Models.EmailTemplate

@{
    ViewBag.Title = "[[[Email Template Update]]]";
}

@section Styles {
    <script src="~/Scripts/ckeditor/styles.js"></script>
}

<div class="wraper container-fluid">

    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading"><h3 class="panel-title">[[[Email Template Update]]]</h3></div>
                <div class="panel-body">
                    <form action="@Url.Action("EmailTemplateUpdate", "Manage")" id="form0" method="post" class="form-horizontal" role="form">
                        @Html.ValidationSummary(true, string.Empty, new { @class = "alert alert-danger" })
                        @Html.Partial("_UserMessage")
                        <div class="form-group">
                            <label class="col-sm-2 control-label">ID</label>
                            <div class="col-sm-10">
                                <p class="form-control-static">@Model.ID</p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">[[[Slug]]]</label>
                            <div class="col-md-10">
                                <input type="text" class="form-control" id="Slug" name="Slug" value="@Model.Slug" readonly required>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">[[[Subject]]]</label>
                            <div class="col-md-10">
                                <input type="text" class="form-control" id="Subject" name="Subject" value="@Model.Subject" required>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label" for="SendCopy">[[[Send Copy]]]</label>
                            <div class="col-md-10">
                                <label class="cr-styled control-label">
                                    <input checked="@Model.SendCopy" id="SendCopy" name="SendCopy" type="checkbox" value="true" />
                                    <i class="fa"></i>
                                    Enabled
                                </label>
                                <input name="SendCopy" type="hidden" value="false" />
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">[[[Body]]]</label>
                            <div class="col-md-10">
                                <textarea class="ckeditor form-control" id="Body" name="Body" rows="10" required>@Model.Body</textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-10">
                                <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> [[[Save]]]</button>
                                <a href="@Url.Action("EmailTemplates", "Manage")" class="btn btn-default"><i class="fa fa-remove"></i> [[[Cancel]]]</a>
                            </div>
                        </div>

                    </form>

                    <form action="@Url.Action("EmailTemplateTest", "Manage")" method="post" class="form-horizontal" role="form">
                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-10">
                                @Html.HiddenFor(x => x.ID)
                                <button class="btn btn-primary" type="submit"><i class="fa fa-envelope"></i> [[[Test Send]]]</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script src="~/Scripts/ckeditor/ckeditor.js"></script>

    <script>
        $(document).ready(function () {
            // Refresh cache
            CKEDITOR.config.allowedContent = true;
            CKEDITOR.timestamp = '@DateTime.Now.Ticks';

            var roxyFileman = '/fileman/index.html';

            CKEDITOR.replace('Body', {
                filebrowserBrowseUrl: roxyFileman,
                filebrowserImageBrowseUrl: roxyFileman + '?type=image',
                removeDialogTabs: 'link:upload;image:upload'
            });
        })
    </script>
}

